Skip to main content

Motor Invoice OCR API

API Description

Objective

The Motor Invoice OCR API extracts the textual data from an image of a motor invoice document and returns it in a JSON format.

InputOutput
An image or PDF file containing a motor invoice document.The textual information extracted from the document.

API URL

https://ind-engine.thomas.hyperverge.co/v1/readMotorInvoice

Overview

The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Authentication

You need a unique pair of application ID ( appId ) and application key (appKey) from HyperVerge to verify your identity for accessing the API.

API Request Details

Method - POST

Headers

ParameterMandatory or OptionalTypeDescriptionValid Values
content-type Mandatory string This parameter defines the media type for the request payload.multipart/form-data
appIdMandatorystringThe application ID shared by HyperVergeNot Applicable - this is a unique value.
appKeyMandatorystringThe application key shared by HyperVergeNot Applicable - this is a unique value.
transactionIdMandatorystringThe unique ID for the customer journey.Not Applicable - this is a unique value related to a transaction in your application.

Inputs

The following table provides the complete information on the parameters used in the request body for the API call.

Parameter Mandatory or Optional Description
image Mandatory The image file containing the motor invoice document.
Caution
  • If you send multiple files in the same API request, the OCR extraction will be performed only on one of the files. Kindly send only one file in a request to avoid confusion.
  • If the PDF file has multiple pages, only the first page will be considered for the OCR extraction.

Sample Request

The following code shows a standard curl request for the API.

curl --location --request POST 'https://ind.thomas.hyperverge.co/v1/readMotorInvoice' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'image=@"<path_to_image_file>"'

Success Response

The following is a successful response sample:

{
"status": "success",
"statusCode": "200",
"result": [
{
"details": {
"totalAmountInWords": {
"value": "<Total_Amount_In_Words>"
},
"totalAmountInFigures": {
"value": "<Total_Amount_In_Figures>"
},
"customerName": {
"value": "<Customer_Name>"
},
"chasisNumber": {
"value": "<Chassis_Number>"
},
"engineNumber": {
"value": "<Engine_Number>"
},
"dealerName": {
"value": "<Dealer_Name>"
},
"invoiceNumber": {
"value": "<Invoice_Number>"
},
"invoiceDate": {
"value": "<Invoice_Date_in_DD/MM/YYYY_Format>"
},
"GSTINNumber": {
"value": "<GSTIN_Number>"
},
"CGSTAmount": {
"value": "<CGST_Amount>"
},
"SGSTAmount": {
"value": "<SGST_Amount>"
}
}
}
],
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}

Success Response Details

ParameterTypeDescription
statusstringThe status of the request
statusCodestringThe HTTP status code returned for the request
resultarrayArray containing the extracted details from the motor invoice
result[].detailsobjectObject containing the extracted fields with their values
result[].details.totalAmountInWordsobjectTotal amount in words extracted from the motor invoice
result[].details.totalAmountInWords.valuestringThe actual total amount in words
result[].details.totalAmountInFiguresobjectTotal amount in figures extracted from the motor invoice
result[].details.totalAmountInFigures.valuestringThe actual total amount in figures
result[].details.customerNameobjectCustomer name extracted from the motor invoice
result[].details.customerName.valuestringThe actual customer name value
result[].details.chasisNumberobjectChassis number extracted from the motor invoice
result[].details.chasisNumber.valuestringThe actual chassis number value
result[].details.engineNumberobjectEngine number extracted from the motor invoice
result[].details.engineNumber.valuestringThe actual engine number value
result[].details.dealerNameobjectDealer name extracted from the motor invoice
result[].details.dealerName.valuestringThe actual dealer name value
result[].details.invoiceNumberobjectInvoice number extracted from the motor invoice
result[].details.invoiceNumber.valuestringThe actual invoice number value
result[].details.invoiceDateobjectInvoice date extracted from the motor invoice
result[].details.invoiceDate.valuestringThe actual invoice date value
result[].details.GSTINNumberobjectGSTIN number extracted from the motor invoice
result[].details.GSTINNumber.valuestringThe actual GSTIN number value
result[].details.CGSTAmountobjectCGST amount extracted from the motor invoice
result[].details.CGSTAmount.valuestringThe actual CGST amount value
result[].details.SGSTAmountobjectSGST amount extracted from the motor invoice
result[].details.SGSTAmount.valuestringThe actual SGST amount value
metaDataobjectMetadata object containing request tracking information
metaData.requestIdstringUnique identifier for the API request
metaData.transactionIdstringUnique identifier for tracking the user journey

Error Responses

{
"status": "failure",
"statusCode": 400,
"error": "API call requires one input image",
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}

Error Response Details

A failure or error response from the module contains a failure status, with a relevant status code and error message.
The following table lists all error responses:

Status CodeError MessageError Description
400No Image inputThe request missed the image input.
400image size cannot be greater than 6MBThe image size is larger than the allowed limit.
422Document Not DetectedThe image file in the request is not a valid motor invoice document.
5xxInternal Server ErrorThere was an error with HyperVerge's server. Please contact the HyperVerge team.
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: